#!/usr/bin/env python
from glob import glob
import numpy as np
from astropy.io import fits
import sys

dir_in = sys.argv[1]
term = sys.argv[2]
val = sys.argv[3] 
files = glob(dir_in+"/*.fits")
print(files)
for i in range(len(files)):
   hdr = fits.open(files[i])[0].header
   data = fits.getdata(files[i])
   hdr[term] = val 
   fits.writeto(files[i],data=data,header=hdr,overwrite=True)
   
